// 用户相关接口
import request from '@/utils/request'
import type { loginForm, loginReponse, UserInfoResponse } from './type'

enum API {
  LOGIN_URL = '/admin/acl/index/login',
  USERINFO_URL = '/admin/acl/index/info',
  LOGOUT_URL = '/admin/acl/index/logout',
}

// <data1,data2> data1是请求参数类型,data2是返回值类型
export const reqLogin = (data: loginForm) =>
  request.post<any, loginReponse>(API.LOGIN_URL, data)

export const reqUserInfo = () =>
  request.get<any, UserInfoResponse>(API.USERINFO_URL)

export const reqLogout = () => request.post<any, any>(API.LOGOUT_URL)
